package net.oxygen.upload.enums;

import lombok.Getter;

/**
 * <p>
 * 枚举功能：枚举类，统一状态码和错误信息
 * 状态码定义约束，共6位数，前三位代表服务，后3位代表接口
 * </p>
 *
 * @author 陈伟伟
 * @since 2023/12/13 10:38
 */
@Getter
public enum BizCodeEnum {

    BAD_REQUEST(401001, "参数错误"),

    NO_ACCESS_ERROR(403001, "无权访问"),
    NO_ACCESS_OPERATION(403002, "无权操作"),

    FILE_UPLOAD_FAIL(610001, "文件流操作失败，上传的文件不合法"),
    FILE_UPLOAD_TOO_MANY(610002, "上传次数过多"),
    FILE_NOT_FOUND(610003, "文件不存在"),
    FILE_EXISTS(610004, "文件已上传"),
    ;

    private final int code;

    private final String message;

    BizCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
}
